import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import camera from '@/store/modules/camera'
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex)
// const vuexLocal = new VuexPersistence({
//   storage: window.localStorage,
//   paths: ['camera']
// })
const create_persist = persistedState({
  key: 'store',
  storage: window.localStorage
})
const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user,
    camera
  },
  getters,
  plugins: [create_persist]
})

export default store
